home *** CD-ROM | disk | FTP | other *** search
/ Digital Talk 87 / Digital_Talk_87_2009-08-17_Digital_Talk_de_Side_C.d64 / sudoku .d-b (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  16KB  |  435 lines

  1. 0 :rem---sudoku-64, dirk breitinger
  2. 1 :poke809,241:poke808,177:on-(s>.)goto14:goto5000
  3. 9 :
  4. 10 :goto26,reset
  5. 11 :return
  6. 12 :a$="0:suduku":gosub910:ifc<60goto14
  7. 13 :open1,8,15,"s"+a$:close1:savea$,8
  8. 14 :gosub9000:goto1000
  9. 19 :
  10. 20 :poke198,.:wait198,7
  11. 21 :geta$:ifa$=""then:d=.:return
  12. 22 :d=asc(a$):on-(d=148)-2*(d=169)goto27,12:ifd<>131thenreturn
  13. 26 :poke53280,6:poke53281,6:print"[146][147]ende"
  14. 27 :gosub940:print"";:sys64789:sys58451:sys42107
  15. 29 :
  16. 30 i=fnr(n):c=a%(i)-i*(a%(i)=.)-1:a%(i)=a%(n)-n*(a%(n)=.):n=n-1:return
  17. 31 :poke19,1:print"[146]"tab(peek(213)):poke19,.:return
  18. 32 :poke211,x:poke214,y:sys58640
  19. 33 :poke646,w:poke199,z:return
  20. 34 forb=b*97to.step-1:b=b*-(peek(198)=.):next:goto21
  21. 35 :open1,0:input#1,a$:close1:a=val(a$):return
  22. 38 :b=peek(53266)+rnd(-ti)and7:forj=.tob:b=rnd(.):next:return
  23. 39 :
  24. 40 :a$="":gosub32:rem---eingabe
  25. 41 :poke198,.:printa$;:x=pos(.):a=peek(209)+peek(210)*256+x:b=peek(a)
  26. 42 :c=band127:if(c>31andc<49)or(c>57andc<96)goto41
  27. 43 :c=peek(a):y=peek(214):pokea,(cand127)-128*(c<127):i=.
  28. 44 :geta$:ifa$=""then:i=i+1:on1-(i<18)goto43,44
  29. 45 :gosub22:pokea,b:c=dand127
  30. 46 :ifc=29then:on1-(d=29andx=24)-(d=157andx=.)goto41,43
  31. 47 :ifc=17then:on1-(y=24andd=17)-(d=145andy=2)goto41,43
  32. 48 :poke780,d:sys59595:ifpeek(781)<16goto41,farbe
  33. 49 :
  34. 50 :on1-((d>48andd<58)orc=32orc=20)goto54:gosub54:remifd(i+10,j)=d(i+20,j)goto40
  35. 51 :ifc>48then:printa$"[157]";:onkgoto40:goto57:zahl
  36. 52 :printg$left$(l$,k)"[160][157]";:d=160:onkgoto40:goto57:weg
  37. 53 :
  38. 54 :i=y/2-1:j=x/2-1:k=-(i<1ori>=10orj<1orj>9)
  39. 55 :w=peek(646):z=peek(199):return
  40. 56 :
  41. 57 :c=.:on-(d<>d(i+10,j)andi<>i%(ij-1)andj<>j%(ij-1))gosub415
  42. 58 :d(i,j)=d:gosub60:goto40
  43. 59 :
  44. 60 :rem---pruefen
  45. 61 :d=val(a$):b=val(chr$(band127)):e=e+(b=.andd>.)-(b>.andd=.)
  46. 62 :f=f-(d+48=d(i+10,j)andd<>b)+(b+48=d(i+10,j)andd<>b)::iff<81then:return
  47. 63 :x=12:y=13
  48. 64 :b=40:gosub75:forb=.to16:a$="[155]":on1+(band1)gosub65,66:ford=.to300:next:next:
  49. 65 :a$="[155][146]":rem--anzeige
  50. 66 :poke214,21:printr$tab(26)a$;:poke213,79
  51. 67 :iff=81then:print"[157] alles gel[st  [157]";:goto69
  52. 68 :print"gel[st : "right$(str$(f+100),2)"  ";
  53. 69 :c=81-f-e:printspc(27)"[146]fehler : "right$(str$(c+100),2)"  ";:return
  54. 70 :c=11:d=.:b=20:rem--wart+effekt
  55. 71 :poke198,.:a=53280:c=d+c:i=peek(a)
  56. 72 forb=b*97to.step-1:sys65374:pokea+.,d:d=c-d:pokea,d:b=b*-(peek(198)=.):next
  57. 73 :pokea,i:goto21:d=c-d
  58. 74 :
  59. 75 :a=53280:c=peek(a):forb=bto.step-1:pokea,fnr(14):next:pokea,c:return
  60. 79 :
  61. 90 b=228:rem--schirm-loesch
  62. 92 :c=peek(648):pokec*256+1000,b:poke88,.:poke89,c+3:poke90,1:poke91,c+3
  63. 93 poke781,4:poke782,232:poke212,.:print"[147]";:sys41964:return
  64. 94 :
  65. 95 :n=81:i=fnp(49)-171:poke50,i/256:poke49,i-peek(50)*256:dima%(n):return
  66. 98 :
  67. 99 :
  68. 198 :
  69. 199 :
  70. 200 :rem---loesbar???
  71. 201 :a=b(b):e=1:f=1:ifh>20goto205
  72. 202 :c=d(.,j):iffnb(c)+fnb(c/32)>7thenreturn
  73. 203 :c=d(i,.):iffnb(c)+fnb(c/32)>7thenreturn
  74. 204 :c=d(fna(.),10):iffnb(c)+fnb(c/32)>7thenreturn
  75. 205 :fork=1to9:ifethen:ifd(k,j)>9andi<>kthen:e=sgn(d(k,.)anda)
  76. 206 :iffthen:ifd(i,k)>9andj<>kthen:f=sgn(d(.,k)anda)
  77. 207 :next:return
  78. 208 :
  79. 209 :
  80. 250 :ifv<1goto11:--suduku-ausgeben
  81. 251 :gosub1190:gosub65
  82. 252 :p=i:o=j:print""g$l$r$g$l$r$g$m$b$g$m$;
  83. 253 :fori=1to9:printspc(15)g$m$h$;:forj=1to7step3
  84. 254 :printg$chr$(d(i,j))"[221]"g$chr$(d(i,j+1))"[221]"chr$(d(i,j+2))h$;:next
  85. 255 :ifi/3>int(i/3)then:printg$m$spc(15)g$m$h$i$h$i$h$i$h$g$m$;:goto257
  86. 256 :printg$m$spc(15)g$m$b$left$("[157][146][169]",7and(i=9))g$m$;
  87. 257 :next:printr$g$l$r$g$l$"";:i=p:j=o:return
  88. 258 :
  89. 259 :
  90. 300 :rem--erzeugen
  91. 301 :gosub38:gosub554,ls:fori=1to9:n=.
  92. 302 :forj=1to9:printf$""tab(20)i+j/10;:ifpeek(198)then:i=99:j=i:goto306
  93. 303 :m=fna(.):c=(d(i,.)ord(.,j)ord(m,10)):ifc=511then:gosub330:goto302
  94. 304 :c=511-c:gosub310:d(i,j)=b+48
  95. 305 :b=b(b):d(i,.)=d(i,.)orb:d(.,j)=d(.,j)orb:d(m,10)=d(m,10)orb
  96. 306 next:next:ifi>90then:gosub550:gosub542
  97. 307 :gosub530,kopie:goto402,deck
  98. 309 :
  99. 310 :b=fnr(9):onbgoto311,312,313,314,315,316,317,318,319
  100. 311 ifcand1then:b=1:return
  101. 312 ifcand2then:b=2:return
  102. 313 ifcand4then:b=3:return
  103. 314 ifcand8then:b=4:return
  104. 315 ifcand16then:b=5:return
  105. 316 ifcand32then:b=6:return
  106. 317 ifcand64then:b=7:return
  107. 318 ifcand128then:b=8:return
  108. 319 ifcand256then:b=9:return
  109. 320 goto311
  110. 329 :
  111. 330 :n=n+1:rem--zeilenloesch
  112. 332 :ifn>29then:gosub333:i=i-1:j=10:n=.
  113. 333 :ifj<2thenreturn
  114. 334 :d(i,.)=.:forj=j-1to1step-1:b=511-b(d(i,j)-48):gosub336:next:j=1:return
  115. 336 :d(.,j)=d(.,j)andb:m=fna(.):d(m,10)=d(m,10)andb:return:--bit-loesch
  116. 339 :
  117. 399 :
  118. 400 :rem--zudecken
  119. 401 :gosub532,kopy:c=511:on-(s>.)gosub565
  120. 402 :poke198,.:d(.,.)=.:ij=.:gosub38:s=int(s):on-(s<.)goto570:ifs>81then:s=81
  121. 403 :gosub95:forh=1tos:gosub30:i=int(c/9):j=c-i*9+1:i=i+1:b=d(i,j)
  122. 404 :gosub410:h=h+(c=.)+s*-(n<1orpeek(198)>.):next
  123. 405 :
  124. 407 :gosub408:goto250,ausgabe
  125. 408 :e=int(abs(d(.,.))):f=81-e:return
  126. 409 :
  127. 410 :rem--abdecken
  128. 411 :gosub420:ifc=.thenreturn
  129. 412 :b=511-b:d(.,j)=d(.,j)andb:d(i,.)=d(i,.)andb:d(m,10)=d(m,10)andb
  130. 413 ifvthen:printf$""tab(14)ij+1"[157] ";
  131. 414 :d(i,j)=fnr(26)+64:d(i+20,j)=d(i,j):d(.,.)=d(.,.)+1
  132. 415 :ij=ij-(ij<81):i%(ij)=i:j%(ij)=j:e%(ij)=c:return
  133. 419 :
  134. 420 :rem---loesbar:anzahl>7,
  135. 421 :b=b(b-48):m=int(fna(.)):c=.:rem:ifh>20goto425
  136. 422 :ifd(.,j)=511then:c=1:return
  137. 423 :ifd(i,.)=511then:c=2:return
  138. 424 :ifd(m,10)=511then:c=3:return
  139. 425 :if(d(.,j)ord(i,.)ord(m,10))=511then:c=4:return
  140. 428 :
  141. 429 :
  142. 430 :a=m-int((m-1)/3)*3:d=1:rem--senkrecht
  143. 431 if((d(a,10)andb)>.anda<>m)goto434
  144. 432 c=((d(d,.)andb)>.ord(d,j)<64)+((d(d+1,.)andb)>.ord(d+1,j)<64)
  145. 433 c=c+((d(d+2,.)andb)>.ord(d+2,j)<64):ifc>-3goto440
  146. 434 ifd<5then:a=a+3:d=d+3:goto431
  147. 435 :c=5:return
  148. 439 :
  149. 440 :a=int((m-1)/3)*3+1:d=1:rem--waagerecht
  150. 441 if((d(a,10)andb)>.anda<>m)goto444
  151. 442 c=((d(.,d)andb)>.ord(i,d)<64)+((d(.,d+1)andb)>.ord(i,d+1)<64)
  152. 443 c=c+((d(.,d+2)andb)>.ord(i,d+2)<64):ifc>-3goto450
  153. 444 ifd<5then:a=a+1:d=d+3:goto441
  154. 445 :c=6:return
  155. 449 :
  156. 450 :gosub480:f=a:rem---feld
  157. 451 :ifd<>jthen:ifd(.,d)andbthen:a=aand511-73
  158. 452 :ifd+1<>jthenifd(.,d+1)andbthen:a=aand511-146
  159. 453 :ifd+2<>jthenifd(.,d+2)andbthen:a=aand511-292
  160. 454 :ifa=.then:c=7:return
  161. 455 :ifc<>ithen:ifd(c,.)andbthen:a=aand511-7
  162. 456 :ifc+1<>ithen:ifd(c+1,.)andbthen:a=aand511-56
  163. 457 :ifc+2<>ithen:ifd(c+2,.)andbthen:a=aand511-448
  164. 458 :ifa=.then:c=7:return: s:73,146,292,w:7,56,448
  165. 459 :
  166. 460 :f=a:e=d(m,10):rem---feld+restfuell
  167. 461 :ifd=jthen:iffnc(d(.,d)ore)+fnc(fand73)=9then:a=aand73
  168. 462 :ifd+1=jthen:iffnc(d(.,d+1)ore)+fnc(fand146)=9then:a=aand146
  169. 463 :ifd+2=jthen:iffnc(d(.,d+2)ore)+fnc(fand292)=9then:a=aand292
  170. 464 :ifa=.then:c=8:return
  171. 465 :ifc=ithen:iffnc(d(c,.)ore)+fnc(fand7)=9then:a=aand7
  172. 466 :ifc+1=ithen:iffnc(d(c+1,.)ore)+fnc(fand56)=9then:a=aand56
  173. 467 :ifc+2=ithen:iffnc(d(c+2,.)ore)+fnc(fand448)=9then:a=aand448
  174. 468 :ifa=.then:c=8:return
  175. 469 :c=.:return: s:73,146,292,w:7,56,448
  176. 480 :rem--bits:feld3x3
  177. 481 :c=1+int((i-1)/3)*3:d=1+int((j-1)/3)*3
  178. 482 :a=-(d(c,d)>64)-2*(d(c,d+1)>64)-4*(d(c,d+2)>64)
  179. 483 :a=a-8*(d(c+1,d)>64)-16*(d(c+1,d+1)>64)-32*(d(c+1,d+2)>64)
  180. 484 :a=a-64*(d(c+2,d)>64)-128*(d(c+2,d+1)>64)-256*(d(c+2,d+2)>64):return
  181. 485 gosub252:print"[155]"tab(25)i;j":"f"[157]:"a"[157]:";:goto20:
  182. 489 :
  183. 498 :
  184. 499 :
  185. 530 :rem--kopieren
  186. 531 :fori=1to9:forj=1to9:b=d(i,j):d(i+10,j)=b:d(i+20,j)=b:next:next:return
  187. 532 fori=1to9:forj=1to9:b=d(i+10,j):d(i,j)=b:d(i+20,j)=b:next:next:return
  188. 533 :fori=1to9:forj=1to9:d(i,j)=d(i+20,j):next:next:e=.:f=81:return
  189. 534 fori=1to9:forj=1to9:d(i,j)=d(i+10,j):next:next:f=81:e=.:return
  190. 539 :
  191. 540 :s=-abs(s):rem---tausch
  192. 541 :gosub542:gosub400:goto407
  193. 542 :c=511:fori=1to9:gosub310:c=c-b(b):a%(b)=b:next
  194. 543 :fori=11to19:forj=1to9:b=d(i,j)-48:ifb>.andb<10then:d(i,j)=a%(b)+48
  195. 544 :next:printf$""tab(20)i-10:next:return
  196. 549 :
  197. 550 :restore:rem--les
  198. 551 :fori=1to9:forj=1to9:reada:d(i,j)=a+48:next:next:return
  199. 554 :poke49,peek(47):poke50,peek(48)
  200. 555 :dimd(30,10),b(10),i%(81),j%(81),e%(81),a%(81)
  201. 556 :b=1:fori=1to10:b(i)=b:b=b+b:next:return
  202. 558 :
  203. 559 :
  204. 560 :fori=1to9:forj=1to9:d(i,j)=c:next:next:return
  205. 565 :fori=1to9:d(i,.)=c:d(i,10)=c:d(.,i)=c:next:return
  206. 566 :
  207. 570 :c=.:rem--zudecken
  208. 571 :s=abs(s):ifs>81then:s=81
  209. 572 :fork=1tos:i=fnr(9):j=fnr(9):ifd(i,j)<64then:gosub413:k=k+1
  210. 573 :k=k-1:next:goto407
  211. 578 :
  212. 579 :
  213. 580 :rem--abc weg
  214. 581 :fori=1to9:forj=1to9:ifd(i+20,j)>64then:d(i,j)=160
  215. 582 :next:next:goto407
  216. 583 :
  217. 584 :rem--fehler weg
  218. 585 :fori=1to9:forj=1to9:ifd(i,j)<>d(i+10,j)then:d(i,j)=160
  219. 586 :next:next:goto407
  220. 589 :
  221. 590 :gosub65:rem--markieren
  222. 591 :b=204:b=peek(648)*256+b::fori=1to9:forj=1to9:c=(peek(b)and127)
  223. 592 :ifc<>d(i+10,j)andc<>96then:pokeb,peek(b)and127
  224. 593 :b=b+2:next:b=b+62:next:return
  225. 598 :
  226. 599 :
  227. 600 :rem--ausgabe-beiwerte
  228. 601 :on(fa)goto611,612,613,614,615,616,617,618,619,620,621,622,623,624,625
  229. 610 :goto626:rem--farben
  230. 611 :f$="[152]":g$="":c$="":d$="[155]":e$="[152]":f0=11:f1=9:goto640
  231. 612 :f$="[152]":g$="":c$="":d$="[155]":e$="[152]":f0=9:f1=9:goto640
  232. 613 :f$="[152]":g$="":c$="":d$="[155]":e$="[152]":f0=2:f1=9:goto640
  233. 614 :f$="[152]":g$="":c$="[129]":d$="[155]":e$="[152]":f0=9:f1=9:goto640
  234. 615 :f$="[152]":g$="":c$="[129]":d$="[155]":e$="[152]":f0=2:f1=9:goto640
  235. 616 :f$="[152]":g$="":c$="[129]":d$="[155]":e$="[152]":f0=8:f1=9:goto640
  236. 617 :f$="[152]":g$="":c$="[129]":d$="[155]":e$="[152]":f0=9:f1=11:goto640
  237. 618 :f$="[152]":g$="":c$="[154]":d$="[153]":e$="[152]":f0=11:f1=11:goto640
  238. 619 :f$="[152]":g$="":c$="[154]":d$="[153]":e$="[152]":f0=9:f1=11:goto640
  239. 620 :f$="[152]":g$="":c$="[154]":d$="[153]":e$="[152]":f0=15:f1=11:goto640
  240. 621 :f$="[152]":g$="":c$="[154]":d$="[153]":e$="[152]":f0=14:f1=11:goto640
  241. 622 :f$="[152]":g$="":c$="[155]":d$="[154]":e$="":f0=1:f1=11:goto640
  242. 623 :f$="[152]":g$="":c$="[155]":d$="[154]":e$="":f0=11:f1=11:goto640
  243. 624 :f$="[152]":g$="":c$="[155]":d$="":e$="[152]":f0=11:f1=11:goto640
  244. 625 :f$="[152]":g$="":c$="[155]":d$="":e$="[152]":f0=1:f1=11:goto640
  245. 626 :f$="[152]":g$="":c$="":d$="[155]":e$="[152]":f0=1:f1=11:goto640
  246. 640 :rem--ausgabe-beiwerte
  247. 642 :l$=c$+"[160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160]"
  248. 643 :b$=f$+"                   ":i$=g$+"-+-+-":h$=f$+" ":m$=left$(l$,5)
  249. 644 :r$=chr$(13):return
  250. 649 :
  251. 650 :rem---farb-einstellung
  252. 651 :deffna(a)=peek(59610+(peek(a)and15))
  253. 652 :c=29:print""tab(c)"[157][146]-"g$" "f$" "left$(m$,3)d$" "e$" ";
  254. 653 :printchr$(fna(53281))" "chr$(fna(53280))" [146]-";
  255. 654 :print""tab(30):gosub35
  256. 655 :b=55296+c:g$=chr$(fna(b))+"":f$=chr$(fna(b+1))+""
  257. 656 :c$=chr$(fna(b+2)):d$=chr$(fna(b+3)):e$=chr$(fna(b+4))
  258. 657 :f1=peek(b+5):f0=peek(b+6):goto642
  259. 658 :
  260. 659 :
  261. 900 :j=1:rem--disk aus,weg
  262. 901 :open1,8,15:close1:ifstthen:return
  263. 902 :open1,8,15,"i":input#1,j:close1:return
  264. 910 :c=.:rem--blocks
  265. 911 :poke768,61:open1,8,.,"$"+a$:poke768,139:poke781,1:sys65478:ifstgoto915
  266. 912 :j=17:gosub916:c=a+b*256:j=.:gosub916:ifa<>66then:j=14:gosub916:c=c+a+b*256
  267. 915 :sys65484:close1:return
  268. 916 :forj=-jto.:sys61758:a=peek(780):sys61758:next:b=peek(780):return
  269. 919 :
  270. 940 :rem---var-init/save
  271. 941 print"";:::poke45,226:poke46,059:poke47,001:poke48,061:poke49,157:poke50,070
  272. 942 :a=peek(113)+peek(114)*256:pokea+2,142:return
  273. 944 :gosub940:gosub942:pokea+2,58:fori=45to50:a=a+3+len(str$(peek(i)+1000))
  274. 945 forj=.to2:pokea+j,peek(257+j):nextj,i:poke45,peek(49):poke46,peek(50):run12
  275. 949 :
  276. 999 :
  277. 1000 :rem---haupt-programm
  278. 1010 :poke53265,11:print"[150]";
  279. 1100 :print"[147]"l$r$l$f$" "d$"sudoku64:"f$" "d$left$(l$,1)r$f$"[164][164][164][164][164][164][164][164][164][164][164]"
  280. 1120 a=26:print""
  281. 1130 :printtab(a)d$"(f1)nochmal"spc(28)e$"[146][163][163][163][163] [163][163][163][163][163][163][163]"
  282. 1131 :printtab(a)d$"(f3)erzeugen"spc(27)e$"[146][163][163][163][163] [163][163][163][163][163][163][163][163]"
  283. 1132 :printtab(a)d$"(f5)spielen"spc(28)e$"[146][163][163][163][163] [163][163][163][163][163][163][163]"
  284. 1133 :printtab(a)d$"(f7)pr@fen "spc(28)e$"[146][163][163][163][163] [163][163][163][163][163][163][163]"
  285. 1139 :poke214,9 :printd$
  286. 1140 :printtab(a)"(a)[146]bronze"
  287. 1141 :printtab(a)"(b)[146]silber"
  288. 1142 :printtab(a)"(c)[146]gold"
  289. 1143 :printtab(a)"(d)[146]deckzahl"
  290. 1144 :printtab(a)"(e)[146]aufdecken"
  291. 1145 :printtab(a)"(f)[146]markieren"
  292. 1146 :printtab(a)"(g)[146]abc-weg"
  293. 1147 :printtab(a)"(h)[146]anleitung"
  294. 1148 :printtab(a)"(o)[146]farb-wahl"
  295. 1149 :printtab(a)"(m)[146]zeig-tipp"
  296. 1150 :printtab(a)"(@)[146]speichern"
  297. 1160 :
  298. 1180 :v=v+1:gosub250,sudoku
  299. 1181 :poke53281,f1:poke53280,f0:poke53265,27
  300. 1182 :forb=.to59:next:ifv=1then:b=30:gosub75
  301. 1185 :goto1200
  302. 1189 :
  303. 1190 :ifs>81ors<1then:s=81
  304. 1191 :c=21:printf$""tab(c);s"[157] "tab(c+1):return
  305. 1199 :
  306. 1200 :x=12:y=13:printg$"[129]";:gosub55
  307. 1210 :gosub40::ifa$=""goto1200
  308. 1211 :ifa$="[133]"then:gosub533:v=1:gosub407:goto1182,nochmal
  309. 1212 :ifa$="[134]"ora$="[138]"then:on1-(d>136)gosub300,540:goto1200:rem-erzeugen
  310. 1213 :ifa$="[135]"ora$="[139]"then:s=s*sgn(136-d):gosub400:goto1200:rem-spielen
  311. 1214 :ifa$=r$ora$="[136]"then:gosub65,pruef
  312. 1216 :ifa$="[137]"then:gosub585:goto1200
  313. 1219 :ifa$="/"ora$="."ora$=","ora$="m"then:gosub1300,tipp
  314. 1230 :ifd=89ord=217then:a=53281:pokea,peek(a)-sgn(d-99)and15:f1=peek(a)
  315. 1231 :ifd=85ord=213then:a=53280:pokea,peek(a)-sgn(d-99)and15:f0=peek(a)
  316. 1232 :on-(d=3)goto1180:ifa$="_"ora$="h"goto5000,hilfe
  317. 1233 :ifa$="\"then:gosub650:goto1000
  318. 1234 :ifa$="o"ora$="p"then:fa=fa+1+2*(a$<>"o")and15:gosub600:goto1000
  319. 1235 :ifa$="@"ora$="*"then:v=.:gosub900:ifj=.thengosub944,save
  320. 1239 :
  321. 1240 :d=d-64:ifd>.andd<4then:s=-(d=1)*34-(d=2)*44-(d=3)*54:gosub1190
  322. 1244 :ifd=4then:gosub1310,zahl
  323. 1245 :ifd=5then:gosub534:gosub250,aufdecken
  324. 1246 :ifd=6then:gosub590,-markieren
  325. 1247 :ifd=7then:gosub580,-abc-weg
  326. 1250 :goto1210
  327. 1299 :
  328. 1300 :on-(ij<1)goto11:rem--anzeig
  329. 1301 :b=i%(ij):c=j%(ij):ifd(b,c)=d(b+10,c)then:gosub1303:goto1300
  330. 1302 :print""tab(27)b"[157]";-c"[157]:"chr$(d(b+10,c))"[146] "chr$(64+e%(ij))
  331. 1303 :ij=ij+(ij>.):return
  332. 1309 :
  333. 1310 :print""tab(21)s"[157] "::gosub20:ifa$=""ora$="[145]"then:s=s-(s<81):goto1310
  334. 1311 :on1-(a$="[157]"ora$="")goto1190:s=s+(s>10):goto1310
  335. 1319 :
  336. 1999 :
  337. 3999 :
  338. 4998 :
  339. 4999 :
  340. 5000 :poke53265,11:rem---anleitung
  341. 5010 :ifpeek(648)<204orpeek(53272)<>53then:gosub9500:clr
  342. 5100 :poke53280,11:poke53281,11:print"[152]";:gosub90
  343. 5102 :print"[142][146]: sudoku :[152][146] hallo,
  344. 5103 :[153]"flistreundedeszudeckundabz]hl-r]tsels.
  345. 5104 :print
  346. 5105 :print"[159] die regeln sind einfach             [155][146]"
  347. 5106 :print"i[155]n einer zeile (von links nach rechts)
  348. 5107 :[153]"in einer spalte (von oben nach unten)
  349. 5108 :print"in einem kasten (3x3) befinden sich
  350. 5109 :[153]"die ziffern von eins bis neun (1-9).
  351. 5110 :print
  352. 5111 :print"d[155]avon wird dann eine bestimmte anzahl
  353. 5112 :[153]"vom rechner verdeckt, die der  rater
  354. 5113 :print"mit @berlegung wieder aufdecken mu\.
  355. 5114 :[153]
  356. 5115 :[143]nt
  357. 5116 :[153]"print dabei gibt es folgende hilfen       list"
  358. 5117 :[153]"(f7)  anzeige der fehlerzahl
  359. 5118 :print"(f8)  markieren der fehler
  360. 5119 :[153]"(g )  l[schen der a-z platzhalter
  361. 5120 :print"(m.)  tipp geben lassen
  362. 5121 :[153]"dlistar@berhinaus kann man sich am rand
  363. 5122 :print"notizen machen und die zeichenfarbe
  364. 5123 :[153]"mit (ctrl/cbm/tab 1-8) bestimmen.
  365. 5124 :print
  366. 5150 poke213,40:print"[152] *** dirk-breitinger freisoft(2008) *** "
  367. 5200 :poke53265,27:on-(s=.)gosub9000:b=80:gosub70:goto1000
  368. 5998 :
  369. 5999 :
  370. 9000 :rem---vorbereit
  371. 9005 :gosub940:if(s)goto640
  372. 9010 :dim i,j,a,b,c,d,s,n,v,a$,b$,c$,d$,e$,f$,l$,x,y,w,z
  373. 9020 :s=-34:fa=1
  374. 9030 :deffnr(a)=int(rnd(1)*a+1)
  375. 9031 :deffna(a)=int((i-1)/3)*3+(j-1)/3+1
  376. 9032 :deffnb(a)=sgn(aand16)+sgn(aand8)+sgn(aand4)+sgn(aand2)+(aand1)
  377. 9033 :deffnc(a)=fnb(a)+fnb(a/32)
  378. 9035 :deffnp(a)=peek(a)+peek(a+1)*256
  379. 9050 :gosub554:gosub550:gosub530,fuell
  380. 9060 :gosub400:goto600
  381. 9098 :
  382. 9099 :
  383. 9100 :
  384. 9140 :data2,1,8,5,9,6,7,4,3
  385. 9141 :data7,6,9,2,3,4,5,1,8
  386. 9142 :data3,5,4,8,7,1,6,2,9
  387. 9143 :data4,9,1,3,6,5,8,7,2
  388. 9144 :data8,2,3,4,1,7,9,6,5
  389. 9145 :data6,7,5,9,2,8,4,3,1
  390. 9146 :data9,4,7,1,8,2,3,5,6
  391. 9147 :data1,3,6,7,5,9,2,8,4
  392. 9148 :data5,8,2,6,4,3,1,9,7
  393. 9198 :
  394. 9199 :
  395. 9200 :1,3,9,4,7,6,5,8,2:
  396. 9201 :4,8,7,5,2,1,9,3,6:
  397. 9202 :5,6,2,8,3,9,4,1,7:
  398. 9203 :6,2,5,1,8,3,7,4,9:
  399. 9204 :9,4,3,6,5,7,1,2,8:
  400. 9205 :8,7,1,9,4,2,6,5,3:
  401. 9206 :2,9,4,3,6,5,8,7,1:
  402. 9207 :3,5,6,7,1,8,2,9,4:
  403. 9208 :7,1,8,2,9,4,3,6,5:
  404. 9298 :
  405. 9299 :
  406. 9300 :
  407. 9400 :
  408. 9500 :rem----zeichen-install
  409. 9520 :gosub9550,copy
  410. 9530 :a=53248:rem--zeichen-poke
  411. 9531 :h=a:c=peek(1):poke56334,.:poke1,51
  412. 9532 :fora=ato65535:readb:ifb>=.andb<256then::pokea,b:pokea+1024,255-b:goto9534
  413. 9533 :a=b-1:ifb<.then:a=h+8*int(abs(b))-1:ifb=-.11then:a=66000
  414. 9534 :next:poke1,c:poke56334,1:return
  415. 9539 :
  416. 9540 :
  417. 9550 :rem--rom/ram,bild:52224,satz:53248
  418. 9551 :poke56334,.:poke88,.:poke89,.:poke90,.:poke91,.:poke781,97:poke782,.
  419. 9552 :poke1,peek(1)-4:sys41971:poke1,53:poke56334,1
  420. 9553 :poke646,peek(53281):poke648,204:sys58692:poke53272,53:poke56576,196
  421. 9554 :a=43039:pokea,61:pokea+2,.:pokea+4,62:restore:return:--restore zeile
  422. 9559 :
  423. 9560 :rem---umlaut-daten einfuegen
  424. 9563 ::data-29,36 ,60,102,126,102,102,102,:-ae
  425. 9564 ::data-27,36,60,102,102,102,102,60,:-oe
  426. 9565 ::data-.1,36,102,102,102,102,102,60,:-ue
  427. 9566 ::data-28,60,102,102,108,102,102,108,96,-.11:-sz
  428. 9567 :
  429. 9899 :
  430. 9900 :gosub9997:rem--prg abschneiden(a)
  431. 9910 :pokea,.:pokea+1,.:a=a+2:poke9,a/256:poke45,a-peek(9)*256:poke46,peek(9)
  432. 9920 :return
  433. 9997 deffn p(a)=peek(a)+peek(a+1)*256
  434. 9998 a=fnp(fnp(61)+1):e=fnp(45)-1:return:rem---letzte zeile
  435.